﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;

namespace csharpcore7_ch14_ConcurrencyAndAsynchrony
{
    class THreadSafe
    {
        static bool _done;
        static readonly object _locker = new object();


        static void _Main()
        {
            new Thread(Go).Start();
            Go();
        }

        static void Go()
        {
            lock (_locker)
            {
                if (!_done) { Console.WriteLine("done"); _done = true; }
            }

        }
    }
    class chapt14_2_5LocksAndThreadSafety
    {
    }
}
